package com.winshare.saleAssistant.mapper;

import com.winshare.saleAssistant.domain.entity.ArticleDO;
import com.winshare.saleAssistant.domain.query.ArticleQuery;
import com.winshare.saleAssistant.domain.dto.req.*;
import com.winshare.saleAssistant.domain.dto.resp.ArticlePreviewDTO;
import com.winshare.saleAssistant.domain.dto.resp.ArticleRespDTO;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface ArticleMapStruct {

    ArticleMapStruct INSTANCE = Mappers.getMapper(ArticleMapStruct.class);

    ArticleDO fromArticleCreateDTO(ArticleCreateDTO articleCreateDTO);

    ArticleDO fromArticleUpdateDTO(ArticleUpdateDTO articleUpdateDTO);

    ArticleDO fromArticleDeleteDTO(ArticleDeleteDTO articleDeleteDTO);

    ArticleQuery fromArticleQueryDTO(ArticleQueryDTO articleQueryDTO);

    List<ArticleRespDTO> fromArticleDOList(List<ArticleDO> articleDOList);

    ArticleRespDTO fromArticleDO(ArticleDO articleDO);

    ArticleDO fromArticleIdDTO(ArticleIdDTO articleIdDTO);

    ArticlePreviewDTO fromArticleDOToArticlePreDTO(ArticleDO articleDOInSql);

    ArticleDO fromBaseIdDTO(BaseIdDTO baseIdDTO);

    ArticleIdDTO fromArticleDO1(ArticleDO articleDO);

    ArticleDO fromArticleSortDTO(ArticleSortDTO articleSortDTO);
}
